<template>
	<view class="contact-customer-service">
		<!-- 自定义模态框  联系客服-->
		<u-overlay :show="show" opacity="0.6">
			<view class="warp">
				<view class="po-re" :style="{top:top}" 
					style="width:600rpx ;box-sizing:border-box;min-height:250rpx;border-radius: 16rpx;background-color: #ffffff;overflow: hidden;">
					<view class="po-ab w-100 b-box p-x-30" @click="Close" style="right: 42rpx;top:30rpx;width: 20rpx;height: 20rpx;" v-if="showCloseIcon">
						<text style="font-size: 42rpx;color: #666666;" @click="Close">×</text>
					</view>
					<!-- 标题 -->
						<view class="d-flex flex-c ali-i-c just-c b-box p-x-30" v-if="title" style="margin: 52rpx 0;">
							<view class=" d-flex flex-c ali-i-c just-c po-re" style="margin-bottom: 20rpx;">
								<image v-if="success" :src="require('@/static/icon/qidong4.png')" style="width: 80rpx;height:80rpx;margin-bottom: 16rpx;"></image>
								<image v-else-if="!success" :src="require('@/static/kefu2.png')" style="width: 115rpx;height:132rpx;margin-bottom: 16rpx;"></image>
								<text v-if="userName" style="font: 400 34rpx PingFang SC;color: #333333;margin-bottom: 4rpx;">{{userName}}</text>
							</view>
							
							<text style="font: 400 34rpx PingFang SC;color: #333333;">{{title}}</text>
						</view>
					<!-- 按钮 -->
					<view style="width: 100%;border-top: 2rpx solid #f1f1f1;" 
						:style="{justifyContent:cancelText?'space-between':'center'}"
						class="d-flex flex-r ali-i-c just-sw b-box" >
						<!-- 取消 -->
						<view v-if="cancelText"
							class="d-flex flex-r ali-i-c just-c" @click="cancel"
							:style="{color:Cancelcolor,height:height}"
							style="flex: 1;">
							<text style="font:500 32rpx PingFang SC;">{{cancelText}}</text>
						</view>
						<!-- 确定 -->
						<view  v-if="confirmText"
							class="d-flex flex-r ali-i-c just-c" @click="confirm" 
							:style="{color:color,height:height}"
							style="background: #ffffff;flex: 1;border-left: 2rpx solid #f1f1f1;">
							<text style="font:500 32rpx PingFang SC;">{{confirmText}}</text>
						</view>
					</view>
				</view>
			</view>

		</u-overlay>
	</view>
</template>

<script>
	export default {
		name: "custom-model",
		props:{
			top:{
				type:String,
				default:'0rpx'
			},
			title:{
				type:String,
				default:''
			},
			userName:{
				type:String,
				default:''
			},
			show:{
				type:Boolean,
				default:false
			},
			confirmText:{
				type:String,
				default:'确定'
			},
			showCloseIcon:{
				type:Boolean,
				default:false,
			},
			cancelText:{
				type:String,
				default:'取消'
			},
			success:{
				type:Boolean,
				default:true
			},
			borderColor:{
				type:String,
				default:'1rpx solid #26387C'
			},
			color:{
				type:String,
				default:'#26387C'
			},
			CancelborderColor:{
				type:String,
				default:'2rpx solid #DDDDDD'
			},
			Cancelcolor:{
				type:String,
				default:'#333333'
			},
			height:{
				type:String,
				default:'60rpx'
			},
			width:{
				type:String,
				default:'260rpx'
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			Close(){
				this.$emit('ModelCancel')
			},
			confirm(){
				this.$emit('confirm',1)
				
			},
			cancel(){
				this.$emit('cancel',0)
				
			}
		}
	}
</script>

<style lang="scss">
	.contact-customer-service {
		.warp {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: row;
			height: 100%;
		}
			
		
	}
</style>
